/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hibernatetests1;

import my.hibernate.Helper;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

/**
 *
 * @author Manu
 */
public class HibernateTestsB {

    public static void main(String[] args) {
        System.out.println(
                "Initializing hibernate and getting the SessionFactory ...");
        Configuration configuration = new AnnotationConfiguration().configure();
        SessionFactory sessionFactory = configuration.buildSessionFactory();
        Session session = sessionFactory.getCurrentSession();

        session.beginTransaction();
        
//        Helper.createRecords(session);
        Helper.deleteRecords(session);
        
        session.getTransaction().commit();
    }
}
